/**
 * Descriptions：
 * <p>
 * Author：ChenME
 * Date：2017/6/30
 * Email：ibelieve1210@163.com
 */

import Dimensions from 'Dimensions';
var {width} = Dimensions.get('window');
let ScreenWidth = width;

function dealWithIconUrl(iconUrl, wh) {
    dealWithIconUrl(iconUrl, wh, wh);
}

function dealWithIconUrl(iconUrl, width, height) {
    let flag = 'w.h';
    let value = width + '.' + height;
    if (iconUrl.search(flag) == -1) {
        //没有找到包含'w.h'的字符，正常返回
        return iconUrl;
    } else {
        return iconUrl.replace(flag, value);
    }
}

export {dealWithIconUrl,ScreenWidth};